package leetCode.hw.string;

import java.util.ArrayList;
import java.util.List;

public class HJ5Solution implements HJ5 {

    @Override
    public List<String> splitStr(String str) {
        List<String> result = new ArrayList<>();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<str.length();) {
            if(sb.length()<8) {
                sb.append(str.charAt(i));
                i++;
            }
            else {
                result.add(sb.toString());
                sb.delete(0,sb.length());
            }
        }
        if(sb.length()>0){
            while(sb.length()<8){
                sb.append("0");
            }
            result.add(sb.toString());
        }
        return result;
    }

}
